package com.alibaba.moco.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtils {
	
	private static Properties  prop;
	
	private static Properties getPropertiesUtils(){
		
		if(prop==null){
			try {
			prop=new Properties();
			InputStream in = Object.class.getResourceAsStream("/config.properties");
			prop.load(in);
			} catch (IOException e) {
				e.printStackTrace();
			}
			return prop;
		}else{
			return prop;
		}
		
	}
	
	public static String getAttribute(String key){
		
		return getPropertiesUtils().getProperty(key).trim();
	}
	
	
	
}
